package com.sniff.atp.manage;

import com.sniff.atp.constant.LoginConstant;
import com.sniff.atp.service.login.SystemLoginService;
import com.sniff.atp.service.login.WMSLoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class LoginManage {

    @Value("${sniff.system.username}")
    private String systemUsername;
    @Value("${sniff.system.password}")
    private String systemPassword;
    @Value("${sniff.wms.username}")
    private String wmsUsername;
    @Value("${sniff.wms.password}")
    private String wmsPassword;

    @Autowired
    private WMSLoginService wmsLoginService;
    @Autowired
    private SystemLoginService systemLoginService;


    public void setToken() {
        LoginConstant.systemLoginDTO = systemLoginService.login(systemUsername, systemPassword);
        LoginConstant.wmsLoginDTO = wmsLoginService.login(wmsUsername, wmsPassword);
    }
}
